<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

<sql:setDataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
                   url="jdbc:sqlserver://localhost\\hai:1443;databaseName=test;" user="sa"
                   password="1234567" var="conn" />
<sql:query var="users" dataSource="${conn}">
    SELECT * FROM [test].[dbo].[USER]
</sql:query>



<table border="1" align="center" valign="center">
    <th>Id</th>
    <th>Name</th>
    <th>Address</th>
    <c:forEach var="user" items="${users.rows}">
        <tr>
            <td><c:out value="${user.username}"/>&nbsp;</td>
            <td><c:out value="${user.password}"/>&nbsp;</td>
            <td><c:out value="${user.address}"/>&nbsp;</td>
        </tr>
    </c:forEach>
</table>
